<template>
    <div class="demo">
        <h2 >学校名称:{{name}}</h2>
        <h2>学校地址:{{address}}</h2>
        <button @click="sendSchoolName">点我返回学校名字</button>
    </div>
</template>
<script>
export default {
    name: 'StuSchool',
    props: ['getSchoolName'],
    data () {
        return {
            name: 'wqewqe',
            address: 'zxcxzcx'
        }
    },
    methods: {
        sendSchoolName () {
            this.getSchoolName(this.name)
        }
    }
}
</script>
<style lang="less" scoped>
    .demo {
        background-color: orange;
        padding: 5px;
        h2 {
            color: red;
        }
    }
</style>